package Robot;

import Data.Directions;

/*       N    
 *   NW--|--NE
 * W --------- E
 *   SW--|--SE
 *       S
 */

public enum RobotAction  {
	MOVE_NORTH(0),
	MOVE_SOUTH(1),
	MOVE_EAST(2),
	MOVE_WEST(3),
	MOVE_NE(4),
	MOVE_SE(5),
	MOVE_SW(6),
	MOVE_NW(7),
	MOVE_STAY(8),
	
	// statusy
	
	EXPLORING(9),
	FOLLOWING(10),
	RETURNING(11),
	DO_NOTHING(-1);
	

	private int code;

	 private RobotAction(int c) {
	   code = c;
	 }

	 public int getCode() {
	   return code;
	 }
	 
	 public static RobotAction getRobotAction(int code) {
		   switch(code) {
		    case 0: return MOVE_NORTH;  
		    case 1: return MOVE_SOUTH; 
		    case 2: return MOVE_EAST;
		    case 3: return MOVE_WEST;
		    case 4: return MOVE_NE;
		    case 5: return MOVE_SE;
		    case 6: return MOVE_SW;
		    case 7: return MOVE_NW;
		    case 8: return MOVE_STAY;
		    case 9: return EXPLORING;
		    case 10: return FOLLOWING;
		    case 11: return RETURNING;
		    case -1: return DO_NOTHING;
		    default: return MOVE_NORTH;
		   }
		 }

}
